import { Component, OnInit } from '@angular/core';
import {LoginReq, UserApi} from "../../../api/UserApi";

@Component({
  selector: 'app-register',
  templateUrl: './register.component.html',
  styleUrls: ['./register.component.scss']
})
export class RegisterComponent implements OnInit {
  username:string|undefined
  password:string|undefined
  repeatPassword:string|undefined
  constructor() { }

  ngOnInit(): void {
  }

  async doRegister(){
    const result = await UserApi.Register(new LoginReq(this.username!,this.password!));
    if (result.success()) {
      alert('注册成功!')
    }else{
      result.handlerErrorMsg()
    }
  }
}
